package de.justphil.tcg.tcgserver.websockets.messages;

import net.jcip.annotations.Immutable;

import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;

//omit 'null' values when serializing to json
@Immutable
@JsonSerialize(include = Inclusion.NON_NULL)
public class TCGErrorFragment {
	
	@JsonProperty
	@JsonSerialize(include = Inclusion.NON_DEFAULT)
	private final int code;
	
	@JsonProperty
	private final String msg;
	
	public TCGErrorFragment() {
		this.code = 0;
		this.msg = null;
	}
	
	public TCGErrorFragment(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

}
